export const request=(params)=>{
    return new Promise((resolve,reject)=>{
        wx.request({
           ...params,
           header: { 
            'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
        },
           method:"POST",      
            success: (result) => {
                resolve(result);
            },
            fail: (err) => {
                reject(err);
            },          
        });         
    })
};
export const sendChat=(params)=>{
    return new Promise((resolve,reject)=>{
        wx.request({
           ...params,
           header: { 
            'Content-Type': 'application/json',
        },
           method:"POST",      
            success: (result) => {
                resolve(result);
            },
            fail: (err) => {
                reject(err);
            },          
        });         
    })
};
export const tokenrequest=(params)=>{
    return new Promise((resolve,reject)=>{
        wx.request({
           ...params,
           header: { 
            'Content-Type': 'application/json',
            'token': wx.getStorageSync('token'),
        },
           method:"Get",      
            success: (result) => {
                resolve(result);
            },
            fail: (err) => {
                reject(err);
            },          
        });         
    })
};
